package k2_oop.p9_collection.demo09;

public class Team{

    private int period;
    private int year;
    private String championTeam;

    public Team(int period, int year, String championTeam) {
        this.period = period;
        this.year = year;
        this.championTeam = championTeam;
    }

    public Team(int year) {
        this.year = year;
    }

    public int getPeriod() {
        return period;
    }

    public int getYear() {
        return year;
    }

    public String getChampionTeam() {
        return championTeam;
    }

    @Override
    public String toString() {
        return "Team{" +
                "period=" + period +
                ", year=" + year +
                ", championTeam='" + championTeam + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object obj) {
        Team t = (Team)obj;

        if(this.year==t.year){
            return true;
        }
        return false;
    }
}
